package states 
{
	import statemachine.IState;
	import statemachine.IStateObject;
	
	/**
	 * @author vkozhaev
	 */
	public class State implements IState
	{
		protected var _name:String = "";
		protected var _stateObject:IStateObject;
		protected var _ticks:int=0;
		
		public function State(_stateObject:IStateObject) 
		{
			this._stateObject = _stateObject;
		}
		
		/* INTERFACE statemachine.IState */
		
		public function doBefore():void
		{
			
		}
		
		public function doInProcess():void
		{
			
		}
		
		public function doAfter():void
		{
			
		}
		
		public function get name():String
		{
			return _name;
		}
		
		public function get ticks():int
		{
			return _ticks;
		}
		
		public function set ticks(val:int):void {
			
			this._ticks = val;
			if (_ticks < 0) {
				_ticks = 0;
			}
		}
		public function set stateObject(val:IStateObject):void
		{
			this._stateObject = val;			
		}
		
		public function get stateObject():IStateObject
		{
			return _stateObject;
		}
		
	}

}